package com.fqy.mybatisplus.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * User: fqy
 * Date: 2021/7/28
 * Time: 16:01
 * Describe:
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class User {
//    @TableId(type = IdType.ASSIGN_ID)//全局唯一ID
//    @TableId(type = IdType.AUTO)//自增
//    @TableId(type = IdType.INPUT)
//    @TableId(type = IdType.NONE)
//    @TableId(type = IdType.ID_WORKER)
    private Long id;
    private String name;
    private Integer age;
    private String email;
    //在User表中添加datetime类型的新的字段 create_time、update_time
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;
    @Version
    @TableField(fill = FieldFill.INSERT)
    private Integer version;
    @TableLogic
    @TableField(fill = FieldFill.INSERT)
    private Integer deleted;
    public User(Long id, String name, Integer age, String email) {
        this.id = id;
        this.name = name;
        this.age = age;
        this.email = email;
    }
}
